<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>
  <form action="{:U('brandEdit')}" method="post" class="form-horizontal">
    <div class="form-item">
      <label class="item-label">品牌名称<span class="check-tips"></span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="name" value="{$data.name|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">品牌LOGO<span class="check-tips">（品牌LOGO尺寸要求宽度为：190px，高度为：90px像素的图片；支持格式gif,jpg,png）</span></label>
      <div class="controls">
        {:hook('uploadImages', array('name' => 'pic', 'value' => $data['pic'], 'tpl' => 'baidu/img'))}
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">商品分类</label>
      <select name="cid" <?php if(isset($id) && $id){ ?>onfocus="this.defaultIndex=this.selectedIndex;"
        onchange="this.selectedIndex=this.defaultIndex;"<?php } ?>>
        <option value="0">请选择</option>
        <volist name="class" id="vo">
          <option value="{$vo.id}">{:get_short($vo['name'],10)}</option>
        </volist>
      </select>
    </div>
    <div class="form-item">
      <label class="item-label">排序<span class="check-tips">（越大越靠前）</span></label>
      <div class="controls">
        <input type="text" class="text input-small" name="sort" value="{$data.sort|default=0}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">是否推荐</label>
      <div class="controls">
        <label class="radio"><input type="radio" value="1" name="recommend">是</label>
        <label class="radio"><input type="radio" value="0" name="recommend">否</label>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">是否热门</label>
      <div class="controls">
        <label class="radio"><input type="radio" value="1" name="hot">是</label>
        <label class="radio"><input type="radio" value="0" name="hot">否</label>
      </div>
    </div>
    <div class="form-item">
      <input type="hidden" name="id" value="{$data.id|default=''}">
      <input type="hidden" name="store_id" value="{$data.store_id|default=''}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
  <script type="text/javascript">
    //导航高亮
    highlight_subnav("{:U('Item/brand')}");
    Core.setValue("cid", {$data.cid|default = 0});
    Core.setValue("status", {$data.status|default = 0});
    Core.setValue("recommend", {$data.recommend|default = 0});
    Core.setValue("hot", {$data.hot|default = 0});
  </script>
</block>